/* 五子棋在线对战游戏样式表 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "思源黑体", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #2C3E50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498DB;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #2980B9;
    transform: scale(1.05);
}

.btn-primary {
    background-color: #3498DB;
}

.btn-success {
    background-color: #2ECC71;
}

.btn-danger {
    background-color: #E74C3C;
}

.btn-warning {
    background-color: #E67E22;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #3498DB;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    transform: scale(1.02);
}

/* 登录和注册页面样式 */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 24px;
    color: #2C3E50;
    margin-top: 10px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: block;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.auth-link {
    color: #3498DB;
    text-decoration: none;
    margin-top: 15px;
    display: inline-block;
}

.auth-link:hover {
    text-decoration: underline;
}

.error-message {
    color: #E74C3C;
    font-size: 14px;
    margin-top: 5px;
}

/* 游戏大厅样式 */
.hall-container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
}

.user-panel {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-panel h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2C3E50;
    border-bottom: 2px solid #3498DB;
    padding-bottom: 10px;
}

.user-stats {
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.matching-area {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.matching-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #2ECC71;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.matching-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.6);
}

.matching-status {
    margin-top: 20px;
    font-size: 18px;
}

.timer {
    font-size: 24px;
    margin: 15px 0;
    font-weight: bold;
}

.history-panel {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-panel h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2C3E50;
    border-bottom: 2px solid #3498DB;
    padding-bottom: 10px;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.win {
    color: #2ECC71;
}

.lose {
    color: #E74C3C;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.page-btn {
    padding: 5px 10px;
    margin: 0 5px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.page-btn.active {
    background-color: #3498DB;
    color: white;
    border-color: #3498DB;
}

/* 游戏对战页面样式 */
.game-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
}

.game-info-bar {
    display: flex;
    justify-content: space-between;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.player-info {
    display: flex;
    align-items: center;
}

.player-name {
    font-weight: bold;
    margin-right: 10px;
}

.player-score {
    color: #7f8c8d;
}

.turn-indicator {
    padding: 5px 15px;
    background-color: #3498DB;
    color: white;
    border-radius: 20px;
    font-weight: bold;
}

.board-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-board {
    width: 600px;
    height: 600px;
    background-color: #E9C46A;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    position: relative;
}

.board-cell {
    position: relative;
    cursor: pointer;
}

.board-cell::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.5);
}

.board-cell::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.5);
}

.piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    position: absolute;
    top: 10%;
    left: 10%;
    z-index: 2;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.piece.black {
    background-color: #000000;
}

.piece.white {
    background-color: #FFFFFF;
    border: 1px solid #ddd;
}

.piece.last-move {
    box-shadow: 0 0 0 3px #E74C3C;
}

.game-controls {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-status {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.game-timer {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.game-result {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
}

.result-win {
    background-color: rgba(46, 204, 113, 0.2);
    color: #27AE60;
}

.result-lose {
    background-color: rgba(231, 76, 60, 0.2);
    color: #C0392B;
}

.score-change {
    text-align: center;
    font-size: 20px;
    margin: 15px 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hall-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .history-panel {
        grid-column: span 2;
    }
    
    .game-container {
        grid-template-columns: 1fr;
    }
    
    .game-board {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }
}

@media (max-width: 768px) {
    .hall-container {
        grid-template-columns: 1fr;
    }
    
    .history-panel {
        grid-column: span 1;
    }
    
    .matching-btn {
        width: 150px;
        height: 150px;
        font-size: 20px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.bounce {
    animation: bounce 0.5s ease-in-out;
}

.spin {
    animation: spin 1s linear infinite;
}

/* 加载动画 */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498DB;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}
